package com.ruoyi.common.enums;

/**
 * @author bossking
 * @date 2019/5/23 10:08
 */
public enum CityTypeEnum {

    PROVINCE(1, "省"),
    CITY(2, "市"),
    DISTRICT(3, "区"),
    TOWN(4, "镇");


    private Integer type;
    private String message;


    CityTypeEnum(Integer type, String message) {
        this.type = type;
        this.message = message;
    }

    public Integer getType() {
        return type;
    }

    public String getMessage() {
        return message;
    }

    public static CityTypeEnum findByType(Integer type) {
        for (CityTypeEnum e : values()) {
            if (e.type.equals(type)) {
                return e;
            }
        }
        return null;
    }


}
